def create_cart():
    return list()

def add_item(cart, item):
    cart.append(item)

def show_cart(cart):
    a=len(cart)
    print("输出：")
    print(f"购物车 ({a}件商品):")
    for i in cart:
        print("-",i)

def remove_item(cart, item):
    cart.remove(item)

def cart_total(cart):
    num = len(cart)
    print(f"商品总数：{num}件")


# 创建购物车
cart = create_cart()

# 添加商品
add_item(cart, "牛奶")
add_item(cart, "面包")
add_item(cart, "鸡蛋")

# 显示购物车
show_cart(cart)
# 移除商品
remove_item(cart, "面包")
show_cart(cart)


cart_total(cart)